<%@ page contentType="text/html;charset=UTF-8"%>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<html>
<head>
<title>会员消费明细</title>
<meta name="decorator" content="default" />
<script type="text/javascript">
	$(document).ready(function() {
		disableExitMenu();
	});
</script>
</head>
<body>
	<a href="#" id="cancel" data-role="button"
		data-inline="true" data-rel="back" data-theme="a">返回</a>
	<div data-role="collapsible-set">
		<div id="collapsibleForNewCard" data-role="collapsible"  data-collapsed="false">
			<h4>新开卡(${fn:length(consumeInfo.storeConsumeNewCardList)})</h4>
			<table id="newCardTable" data-collapsed="false" data-role="table" class="ui-responsive table-stroke">
				<thead>
					<tr>
						<th>卡名</th>
						<th>卡号</th>
						<th>零售价</th>
						<th>店面优惠价</th>
						<th>服务专员</th>
					</tr>
				</thead>
				<tbody>
					<c:forEach items="${consumeInfo.storeConsumeNewCardList}"
						var="newCard">
						<tr>
							<td>${fns:getCard(0, newCard.card_type, newCard.card_id).name}
							</td>
							<td>${fns:getCard(0, newCard.card_type, newCard.card_id).number}
							</td>
							<td>${fns:getCard(0, newCard.card_type, newCard.card_id).retail_price}
							</td>
							<td>${fns:getCard(0, newCard.card_type, newCard.card_id).real_price}
							</td>
							<td>${newCard.employee.name}</td>
						</tr>
					</c:forEach>

				</tbody>
			</table>
		</div>
		<div data-role="collapsible" data-collapsed="false">
			<h4>卡充值(${fn:length(consumeInfo.storeConsumeRechargeCardList)})</h4>
			<table id="rechargeCardTable" data-role="table" class="ui-responsive table-stroke">
				<thead>
					<tr>
						<th>卡名</th>
						<th>卡号</th>
						<th>充值内容</th>
						<th>零售价</th>
						<th>店面优惠价</th>
						<th>服务专员</th>
					</tr>
				</thead>
				<tbody>
					<c:forEach items="${consumeInfo.storeConsumeRechargeCardList}"
						var="rechargeCard">
						<tr>
							<td>${fns:getCard(0, rechargeCard.card_type, rechargeCard.card_id).name}
							</td>
							<td>${fns:getCard(0, rechargeCard.card_type, rechargeCard.card_id).number}
							</td>
							<td><c:if test="${not empty rechargeCard.recharge_times}">充值${rechargeCard.recharge_times}次</c:if>
								<c:if test="${not empty rechargeCard.recharge_duration}">充值${rechargeCard.recharge_duration}月</c:if>
								<c:if test="${not empty rechargeCard.recharge_money}">充值${rechargeCard.recharge_money}元</c:if>
							</td>
							<td>${rechargeCard.retail_price}</td>
							<td>${rechargeCard.real_cost}</td>
							<td>${rechargeCard.employee.name}</td>
						</tr>
					</c:forEach>
				</tbody>
			</table>
		</div>
		<div data-role="collapsible" data-collapsed="false">
			<h4>购买产品(${fn:length(consumeInfo.storeConsumeBuyProductList)})</h4>
			<table id="buyProductCardTable" data-role="table" class="ui-responsive table-stroke">
				<thead>
					<tr>
						<th>产品名</th>
						<th>数量</th>
						<th>零售价</th>
						<th>店面优惠价</th>
						<th>合计</th>
						<th>服务专员</th>
					</tr>
				</thead>
				<tbody>
					<c:forEach items="${consumeInfo.storeConsumeBuyProductList}"
						var="buyProductCard">
						<tr>
							<td><c:if
									test="${buyProductCard.storeProduct.product_type == 0 }">
								${buyProductCard.storeProduct.product.name}
							</c:if> <c:if test="${buyProductCard.storeProduct.product_type == 1 }">
								${buyProductCard.storeProduct.storeSelfProduct.name}
							</c:if></td>
							<td>${buyProductCard.amount}</td>
							<td>${buyProductCard.retail_price}</td>
							<td>${buyProductCard.real_cost}</td>
							<td>${buyProductCard.real_cost_total}</td>
							<td>${buyProductCard.employee.name}</td>
						</tr>
					</c:forEach>
				</tbody>
			</table>
		</div>
		<div data-role="collapsible" data-collapsed="false">
			<h4>手工护理(${fn:length(consumeInfo.storeConsumeDoCareList)})</h4>
			<table id="doCareCardTable" data-role="table" class="ui-responsive table-stroke">
				<thead>
					<tr>
						<th>护理项目</th>
						<th>卡名</th>
						<th>卡号</th>
						<th>支付现金</th>
						<th>服务专员</th>
					</tr>
				</thead>
				<tbody>
					<c:forEach items="${consumeInfo.storeConsumeDoCareList}"
						var="doCareCard">
						<tr>
							<td><c:if test="${doCareCard.storeCare.care_type == 0 }">
								${doCareCard.storeCare.care.name}
							</c:if> <c:if test="${doCareCard.storeCare.care_type == 1 }">
								${doCareCard.storeCare.storeSelfCare.name}
							</c:if></td>
							<td><c:if test="${not empty doCareCard.card_id}">
								${fns:getCard(2, doCareCard.payment_type, doCareCard.card_id).name}
							</c:if></td>
							<td><c:if test="${not empty doCareCard.card_id}">
								${fns:getCard(2, doCareCard.payment_type, doCareCard.card_id).number}
							</c:if></td>
							<td><c:if test="${not empty doCareCard.card_id}">
								${doCareCard.real_cost}
							</c:if> <c:if test="${empty doCareCard.card_id}">
								时段卡耗卡
							</c:if></td>
							<td>${doCareCard.employee.name}</td>
						</tr>
					</c:forEach>
				</tbody>
			</table>
		</div>
	</div>
</body>
</html>
